<?php

namespace app\service\payment;

use app\model\ShopsPayment;
use app\service\payment\factory\AirwallexFactory;
use app\service\payment\factory\AsiabillFactory;
use app\service\payment\factory\PayoneerFactory;
use app\service\payment\factory\PaypalFactory;
use app\service\payment\factory\SpreedlyFactory;
use app\service\payment\factory\StripeFactory;
use app\service\payment\gateway\DianDianService;

final class PaymentFactory
{
    public static function factory(int $pay_method)
    {
        return match ($pay_method){
            ShopsPayment::PAY_METHOD_PAYPAL => new PaypalFactory(),//贝宝支付
            ShopsPayment::PAY_METHOD_STRIPE => new StripeFactory(),//stripe
            ShopsPayment::PAY_METHOD_ASIABILL => new AsiabillFactory(),//asiabill
            ShopsPayment::PAY_METHOD_PAYONEER => new PayoneerFactory(),//payoneer
            ShopsPayment::PAY_METHOD_AIRWALLEX => new AirwallexFactory(),//airwallex
            ShopsPayment::PAY_METHOD_DIANDIAN => new DianDianService(),//点点支付
            ShopsPayment::PAY_METHOD_SPREEDLY => new SpreedlyFactory(),//spreedly
            default => new PaypalFactory(),
        };
    }
}